﻿<UserControl 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ViewModel="clr-namespace:WpfCardGame.ViewModel"
             xmlns:local="clr-namespace:WpfCardGame.Views" x:Class="WpfCardGame.Views.PokerView"
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="850">
    <UserControl.DataContext>
        <ViewModel:PokerViewModel/>
    </UserControl.DataContext>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="215"/>
            <RowDefinition Height="215"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Image x:Name="imgBackground" 
			   Width="850" Stretch="Fill"
			   Source="C:\Temp\CardImages\poker_background.jpg"
			   Grid.RowSpan="2"/>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <Image x:Name="imgDealerCard1" 
                   Width="120" Height="172" 
                   Margin="20,0,10,0" 
                   Source="{Binding DealersCards[0].ImageInUse}"/>
            <Image x:Name="imgDealerCard2" Width="120" Height="172" Margin="10,0,10,0" Source="{Binding DealersCards[1].ImageInUse}"/>
            <Image x:Name="imgDealerCard3" Width="120" Height="172" Margin="10,0,10,0" Source="{Binding DealersCards[2].ImageInUse}"/>
            <Image x:Name="imgDealerCard4" Width="120" Height="172" Margin="10,0,10,0" Source="{Binding DealersCards[3].ImageInUse}"/>
            <Image x:Name="imgDealerCard5" Width="120" Height="172" Margin="10,0,10,0" Source="{Binding DealersCards[4].ImageInUse}"/>
            <StackPanel Orientation="Vertical">
                <Label x:Name="lblDealer" 
					   Content="Dealer" 
					   Margin="0,30"
					   HorizontalAlignment="Left"
					   VerticalAlignment="Top" 
					   FontFamily = "Snap ITC"
                       Foreground="White"
                       FontSize = "24"/>
                <StackPanel Orientation="Vertical">
                    <Label x:Name="lblDTotal" 
						   Content="Hand:" 
						   HorizontalAlignment="Left"
						   VerticalAlignment="Top"
                           Foreground="White"
						   FontSize="16"/>
                    <TextBlock x:Name="tbDTotal" 
						       Margin="5,2,0,0"
						       FontSize="24"
                               FontWeight="Light"
                               Foreground="White"
                               Text="{Binding DealerTotal}"
						       TextAlignment="Left"/>
                </StackPanel>
            </StackPanel>
        </StackPanel>

        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <StackPanel Orientation="Vertical" Margin="10,0,0,0">
                <Image x:Name="imgPlayerCard1" Width="120" Height="172" Margin="10,10,10,0" Source="{Binding PlayersCards[0].ImageInUse}"/>
                <CheckBox x:Name="cbCard1" Margin="0,10,0,0"  Width="13" IsChecked="{Binding PCard1}" IsEnabled="{Binding CheckBoxesEnabled}"></CheckBox>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <Image x:Name="imgPlayerCard2" Width="120" Height="172" Margin="10,10,10,0" Source="{Binding PlayersCards[1].ImageInUse}"/>
                <CheckBox x:Name="cbCard2" Margin="0,10,0,0"  Width="13" IsChecked="{Binding PCard2}" IsEnabled="{Binding CheckBoxesEnabled}"></CheckBox>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <Image x:Name="imgPlayerCard3" Width="120" Height="172" Margin="10,10,10,0" Source="{Binding PlayersCards[2].ImageInUse}"/>
                <CheckBox x:Name="cbCard3" Margin="0,10,0,0"  Width="13" IsChecked="{Binding PCard3}" IsEnabled="{Binding CheckBoxesEnabled}"></CheckBox>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <Image x:Name="imgPlayerCard4" Width="120" Height="172" Margin="10,10,10,0" Source="{Binding PlayersCards[3].ImageInUse}"/>
                <CheckBox x:Name="cbCard4" Margin="0,10,0,0"  Width="13" IsChecked="{Binding PCard4}" IsEnabled="{Binding CheckBoxesEnabled}"></CheckBox>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <Image x:Name="imgPlayerCard5" Width="120" Height="172" Margin="10,10,10,0" Source="{Binding PlayersCards[4].ImageInUse}"/>
                <CheckBox x:Name="cbCard5"  Margin="0,10,0,0"  Width="13" IsChecked="{Binding PCard5}" IsEnabled="{Binding CheckBoxesEnabled}"></CheckBox>
            </StackPanel>               
            <StackPanel Orientation="Vertical">
                <Label x:Name="lblPlayer" 
					   Content="Player" 
					   Margin="0,30"
					   HorizontalAlignment="Left"
					   VerticalAlignment="Top" 
					   FontFamily = "Snap ITC" 
                       Foreground="White"
                       FontSize = "24"/>
                <StackPanel Orientation="Vertical">
                    <Label x:Name="lblPTotal" 
						   Content="Hand:" 
						   HorizontalAlignment="Left"
						   VerticalAlignment="Top"
                           Foreground="White"
						   FontSize="16"/>
                    <TextBlock x:Name="tbPTotal" 
						       Margin="5,2,0,0"
						       FontSize="26" 
                               FontWeight="Light"
                               Foreground="White"
                               Text="{Binding PlayerTotal}"
						       TextAlignment="Left"/>
                </StackPanel>
            </StackPanel>
        </StackPanel>

        <StackPanel Grid.Row="2" Orientation="Horizontal" Background="#275B1F">
            <Button x:Name="btnDeal"
				    Content="Deal"
				    Margin="10,8,5,8"
				    Height="50"
				    Width="81"
				    FontSize="16"
                    IsEnabled="{Binding DealButtonEnabled}"
                    Command="{Binding DealCommand, Mode=OneWay}">
            </Button>
            <Button x:Name="btnSwitch"				    
				    Margin="5,0,5,0"
				    Height="50"
				    Width="81"
				    FontSize="16" 
                    IsEnabled="{Binding SwitchButtonEnabled}"
                    Command="{Binding SwitchCommand, Mode=OneWay}">
                <TextBlock Text="Switch Cards" 
                           TextWrapping="Wrap" 
                           FontSize="16" 
					       TextAlignment="Center">                    
                </TextBlock>
            </Button>
            <Button x:Name="btnStand"
				    Content="Stand"
				    Margin="5,0,5,0"
				    Height="50"
				    Width="81"
				    FontSize="16"
                    IsEnabled="{Binding StandButtonEnabled}"
                    Command="{Binding StandCommand, Mode=OneWay}"/>
            <Button x:Name="btnNewGame"
				    Margin="50,0,5,0"
				    Height="50"
				    Width="81"
                    IsEnabled="{Binding NewGameButtonEnabled}"
                    Command="{Binding NewGameCommand, Mode=OneWay}">
                <TextBlock Text="New Game" 
					TextWrapping="Wrap" 
					FontSize="16" 
					TextAlignment="Center"/>
            </Button>
            <Label x:Name="lblStatus" 
				Height="50"
				Width="auto"
				Margin="30,8,20,0"
				FontSize="24"
				Content="{Binding Status}"/>
        </StackPanel>


    </Grid>
</UserControl>
